#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>

void main()
{
	clrscr();
 int lnght,store,end=0,flag=0,lnght2;
char master[22][80] =  {

	"ABSTARRY  CPP - Abstract array class definitions",
	"ARRAY     CPP - Source file for classlibs",
	"ASSOC     CPP - Association class (used by dictionary class)",
	"BABSTARY  CPP - Source file for classlibs",
	"BSORTARY  CPP - Source file for classlibs",
	"BTREE     CPP - Tree class definitions ",
	"BTREEINN  CPP - Tree class definitions ",
	"BTREELFN  CPP - Tree class definitions",
	"COLLECT   CPP - Ordered collection class definitions",
	"CONTAIN   CPP - Container class definitions",
	"DBLLIST   CPP - Doubly linked list class definitions ",
	"DEQUE     CPP - Source file for classlibs ",
	"DICT      CPP - Dictinary class definitiions  ",
	"HASHTBL   CPP - Hash table class definitions",
	"LDATE     CPP - Date class definitions  ",
	"LIST      CPP - List class definitions",
	"LTIME     CPP - Time class definitions",
	"MEMMGR    CPP - Memory class definitions",
	"OBJECT    CPP - Base class for other objects",
	"SORTARRY  CPP - Sorted array class definitions",
	  } ;
	  char elemnt[21];


	  cout<<"\n\t welcome to my dictionary\n";
	  cout<<"\n enter the word you want to search(in caps lock): ";
	  cin.getline (elemnt,21);
	  lnght= strlen(elemnt);
	  if('elemnt[0]'>=97&&'element[0]'<=122)

	  {
		strupr(element);
	  }
	  for(int i=0;i<=21;i++)
	  {
		for(int j=0;j<=lnght;j++)
		{

			if(master[i][j] != elemnt[j])
			{
				  flag = 0;
				  break;

			}
			else
			{
				 flag = 1;
				 end = end + 1;
				 store = i;
			   /*	 cout<<"\n end in 1 loop= "<< end<<"\t"<<j; */


			}
		}
			if( end == lnght)
			{
				break;
			}
			else
			{
				end=0;
			}
	  }
	 /*	cout<<"\nend at outer:"<<end;                */
		if(end == lnght)
	       {        lnght2=strlen(master[store]);
		  /*	cout<<lnght2;       */
			for(int k=0;k<=lnght2;k++)
			{
				cout<<master[store][k];
			}
			cout<<" \n found an element "<<"\n";

		}
		else
		{
			cout<<"the word you have entered is not in a dictionary";

		}


	  getch();
	  }
